Dynamic Typing
نویسنده
چکیده
We present an extension of a statically typed language with a special type Dynamic and explicit type tagging and checking operations (coercions). Programs in run-time typed languages are viewed as incomplete programs that are to be completed to well-typed programs by explicitly inserting coercions into them. Such completions are generally not unique. If the meaning of an incomplete program is to be the meaning of any of its completions and if it is too be unambiguous it is necessary that all its completions are coherent (semantically equivalent). We characterize with an equational theory the properties a semantics must satisfy to be coherent. Since “naive” coercion evaluation does not satisfy all of the coherence equations we exclude certain “unsafe” completions from consideration that can cause avoidable type errors at run-time. Various classes of completions may be used, parameterized by whether or not coercions may only occur at data creation and data use points in a program and whether only primitive coercions or also induced coercions. For each of these classes any term has a minimal completion that is optimal in the sense that it contains no coercions that could be avoided by a another coercion in the same class. In particular, minimal completions contain no coercions at all whenever the program is statically typable. If only primitive type operations are admitted we show that minimal completions can be computed in almost-linear time. If induced coercions are also allowed the minimal completion can be computed in time O(nm) where n is the size of the program and m is the size of the value flow graph of the program, which may be of size O(n), but is typically rather sparse. Finally, we sketch how this explicit dynamic typing discipline can be extended to letpolymorphism by parameterization with respect to coercions. The resulting language framework leads to a seamless integration of statically typed and dynamically typed languages by relying on type inference for programs that have no type information and no explicit coercions whatsoever.
منابع مشابه
Rock typing and reservoir zonation based on the NMR logging and geological attributes in the mixed carbonate-siliciclastic Asmari Reservoir
Rock typing is known as the best way in heterogeneous reservoirs characterization. The rock typing methods confine to various aspects of the rocks such as multi-scale and multi-modal pore types and size, rock texture, diagenetic modifications and integration of static/dynamic data. Integration of static and dynamic behavior of rocks and their sedimentary features are practiced in this study. Po...
متن کاملA Review of Reservoir Rock Typing Methods in Carbonate Reservoirs: Relation between Geological, Seismic, and Reservoir Rock Types
Carbonate reservoirs rock typing plays a pivotal role in the construction of reservoir static models and volumetric calculations. The procedure for rock type determination starts with the determination of depositional and diagenetic rock types through petrographic studies of the thin sections prepared from core plugs and cuttings. In the second step of rock typing study, electrofacies are deter...
متن کاملGradual Typing for Functional Languages
Static and dynamic type systems have well-known strengths and weaknesses, and each is better suited for different programming tasks. There have been many efforts to integrate static and dynamic typing and thereby combine the benefits of both typing disciplines in the same language. The flexibility of static typing can be improved by adding a type Dynamic and a typecase form. The safety and perf...
متن کاملCombining Static and Dynamic Typing in Ruby
Title of dissertation: Combining Static and Dynamic Typing in Ruby Michael Furr Doctor of Philosophy, 2009 Dissertation directed by: Professor Jeffrey S. Foster Department of Computer Science Many popular scripting languages such as Ruby, Python, and Perl are dynamically typed. Dynamic typing provides many advantages such as terse, flexible code and the ability to use highly dynamic language co...
متن کاملDynamic Authentication by Typing Patterns TJHSST Senior Research Project Proposal Computer Systems Lab 2009-2010
This project will analyze and test the accuracy of dynamic typing pattern authentication methods. The program will generate a dynamic set of text that the user will be prompted to type, and then it will feed the user’s typing characteristics through neural network structures. Experimentation will be done to determine the most accurate neural network structures and data collection conditions. Th...
متن کاملStatic vs Dynamic Typing for Access Control in Pi-Calculus
Traditional static typing systems for the pi-calculus are built around capability types that control the read/write access rights on channels and describe the type of their payload. While static typing has proved adequate for reasoning on process behavior in typed contexts, dynamic techniques have often been advocated as more effective for access control in distributed/untyped contexts. We stud...
متن کامل